package com.projecy.storehouse.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.projecy.storehouse.dao.RepertoryProductFileDao;
import com.projecy.storehouse.entity.RepertoryProductFile;
import com.projecy.storehouse.entity.dto.PageDto;
import com.projecy.storehouse.service.RepertoryProductFileService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * (ProductFile)表服务实现类
 *
 * @author makejava
 * @since 2023-03-24 16:46:11
 */
@Service("repertoryProductFileService")
public class RepertoryProductFileServiceImpl extends ServiceImpl<RepertoryProductFileDao, RepertoryProductFile> implements RepertoryProductFileService {


    @Autowired
    RepertoryProductFileDao repertoryProductFileDao;


    /**
     * 高级查询
     * @param mark
     * @return
     */
    @Override
    public List seachProductFile(String mark) {
        //查询条件
        QueryWrapper<RepertoryProductFile> wrapper = new QueryWrapper<>();

        //产品已审核
        wrapper.eq("audit_mark","已审核");
        //产品未删除
        wrapper.eq("delete_mark","未删除");
        //库存是否分配
        if(!"".equals(mark) || mark!=null){
            if("未分配".equals(mark)){
                wrapper.eq("repertory_mark","未分配");
            }else if("待分配".equals(mark)){
                wrapper.eq("repertory_mark","待分配");
            }else if("已分配".equals(mark)){
                wrapper.eq("repertory_mark","已分配");
            }
        }
        return repertoryProductFileDao.selectList(wrapper);
    }


}

